package com.prothink.controller;

import com.prothink.entity.JsLog;
import com.prothink.entity.RequestData;
import com.prothink.service.JsLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @ClassName : JsLogController  //类名
 * @Description : 日志MVC  //描述
 * @Author : Zhang //作者
 * @Date: 11/28  21:29
 */
@RequestMapping("/log")
public class JsLogController {
    @Autowired
    private JsLogService jsLogService;
    /*
     * 获取日志
     */
    @RequestMapping("/getLog")
    public RequestData getLog(Integer logType,String type){
        List<JsLog> logList = jsLogService.getLog(logType,type);
        if (logList != null){
            return RequestData.buildSuccess(logList);
        }
        return null;
    }
    /*
     * 删除日志
     */
    @RequestMapping("/deleteLog")
    public RequestData deleteLog(Integer logId){
        Boolean aBoolean = jsLogService.deleteLog(logId);
        if (aBoolean){
            return RequestData.buildSuccess(aBoolean);
        }
        return null;
    }
}
